// exports.AL_GAME_HUA_Global = void 0;
// var r;
// var a;
// var AL_GAME_HUA_i18nMgr = require("./AL_GAME_HUA_i18nMgr");
// var AL_GAME_HUA_EventConfig = require("./AL_GAME_HUA_EventConfig");
// var AL_GAME_HUA_GameConst = require("./AL_GAME_HUA_GameConst");
// var AL_GAME_HUA_GoodsConfig = require("./AL_GAME_HUA_GoodsConfig");
// var AL_GAME_HUA_LatticeConfig = require("./AL_GAME_HUA_LatticeConfig");
// var AL_GAME_HUA_LevelConfig = require("./AL_GAME_HUA_LevelConfig");
// var AL_GAME_HUA_MissionConfig = require("./AL_GAME_HUA_MissionConfig");
// var AL_GAME_HUA_PropConfig = require("./AL_GAME_HUA_PropConfig");
// var AL_GAME_HUA_RankConfig = require("./AL_GAME_HUA_RankConfig");
// var AL_GAME_HUA_ShopConfig = require("./AL_GAME_HUA_ShopConfig");
// var AL_GAME_HUA_GameData = require("./AL_GAME_HUA_GameData");
// var AL_GAME_HUA_Instance = require("./AL_GAME_HUA_Instance");
// var AL_GAME_HUA_Common = require("./AL_GAME_HUA_Common");
// var AL_GAME_HUA_Define = require("./AL_GAME_HUA_Define");
// var AL_GAME_HUA_PlatformManager = require("./AL_GAME_HUA_PlatformManager");
// var AL_GAME_HUA_DateData = require("./AL_GAME_HUA_DateData");
// var AL_GAME_HUA_PayConfig = require("./AL_GAME_HUA_PayConfig");
// var AL_GAME_HUA_PayData = require("./AL_GAME_HUA_PayData");
// var AL_GAME_HUA_ServerTime = require("./AL_GAME_HUA_ServerTime");
// var AL_GAME_HUA_ServerBackup = require("./AL_GAME_HUA_ServerBackup");
// var AL_GAME_HUA_WorldRankConfig = require("./AL_GAME_HUA_WorldRankConfig");
// var AL_GAME_HUA_WelfareConfig = require("./AL_GAME_HUA_WelfareConfig");
// var AL_GAME_HUA_ElementConfig = require("./AL_GAME_HUA_ElementConfig");
// var AL_GAME_HUA_PlayerInfo = require("./AL_GAME_HUA_PlayerInfo");
// (a = r = exports.AL_GAME_HUA_Global || (exports.AL_GAME_HUA_Global = {})).onLoad = function () {
//     return __awaiter(this, void 0, void 0, function () {
//         return __generator(this, function (e) {
//             switch (e.label) {
//                 case 0:
//                     AL_GAME_HUA_EventConfig.EventConfig.getInstance().customEvent("30004");
//                     AL_GAME_HUA_Common.Common.shezhi_anniu_yinyue(AL_GAME_HUA_Define.Define.GAME_NAME, "audio/Button");
//                     AL_GAME_HUA_Common.Common.playMusic("BGM");
//                     AL_GAME_HUA_PlatformManager.PlatformManager.getInstance().init();
//                     AL_GAME_HUA_ServerTime.default.create_Server_Time_Com().then(function () {
//                         AL_GAME_HUA_DateData.DateData.getInstance().jiancha_riqi_he_zhou_shifou_xuyao_shuaxin();
//                         AL_GAME_HUA_PayData.PayData.getInstance().jiancha_zhifu_shuju();
//                     });
//                     AL_GAME_HUA_Instance.Instance.chuangjian_jishiqi_jiluqi();
//                     AL_GAME_HUA_DateData.DateData.getInstance().jiancha_riqi_he_zhou_shifou_xuyao_shuaxin();
//                     AL_GAME_HUA_PayData.PayData.getInstance().jiancha_zhifu_shuju();
//                     AL_GAME_HUA_PlayerInfo.PlayerInfo.getInstance().huoqu_shifou_wei_xin_yonghu();
//                     AL_GAME_HUA_PayConfig.PayConfig.getInstance().jiancha_dingdan();
//                     return [4, Promise.all([AL_GAME_HUA_Instance.Instance.chuangjian_dingbu_gongju_lan()])];
//                 case 1:
//                     e.sent();
//                     return [2];
//             }
//         });
//     });
// };
// a.jiazai_peizhi = function () {
//     return __awaiter(this, void 0, Promise, function () {
//         return __generator(this, function (e) {
//             switch (e.label) {
//                 case 0:
//                     return [4, AL_GAME_HUA_GameConst.GameConst.getInstance().jiazai_peizhi()];
//                 case 1:
//                     e.sent();
//                     AL_GAME_HUA_GameConst.GameConst.getInstance().jiazai_yuancheng_peizhi();
//                     return [4, AL_GAME_HUA_GoodsConfig.GoodsConfig.getInstance().jiazai_peizhi()];
//                 case 2:
//                     e.sent();
//                     return [
//                         4,
//                         Promise.all([
//                             AL_GAME_HUA_LatticeConfig.LatticeConfig.getInstance()
//                                 .jiazai_peizhi()
//                                 .then(function () {}),
//                             AL_GAME_HUA_LevelConfig.LevelConfig.getInstance().jiazai_peizhi(),
//                             AL_GAME_HUA_LevelConfig.LevelConfig.getInstance().jiazai_tiaozhan_guanqia_peizhi(),
//                             AL_GAME_HUA_LevelConfig.LevelConfig.getInstance().jiazai_teshu_guanqia_peizhi(),
//                             AL_GAME_HUA_ElementConfig.ElementConfig.getInstance().jiazai_peizhi(),
//                             AL_GAME_HUA_RankConfig.RankConfig.getInstance().jiazai_peizhi(),
//                             AL_GAME_HUA_ShopConfig.ShopConfig.getInstance().jiazai_peizhi(),
//                             AL_GAME_HUA_PropConfig.PropConfig.getInstance().jiazai_peizhi(),
//                             AL_GAME_HUA_EventConfig.EventConfig.getInstance().jiazai_peizhi(),
//                             AL_GAME_HUA_MissionConfig.MissionConfig.getInstance().jiazai_peizhi(),
//                             AL_GAME_HUA_PayConfig.PayConfig.getInstance().jiazai_peizhi(),
//                             AL_GAME_HUA_WorldRankConfig.WorldRankConfig.getInstance().jiazai_peizhi(),
//                             AL_GAME_HUA_WelfareConfig.WelfareConfig.getInstance().jiazai_peizhi()
//                         ])
//                     ];
//                 case 3:
//                     e.sent();
//                     AL_GAME_HUA_EventConfig.EventConfig.getInstance().customEvent("30006");
//                     return [2];
//             }
//         });
//     });
// };
// a.jinru_diyige_changjing = function () {
//     return __awaiter(this, void 0, Promise, function () {
//         var e = this;
//         return __generator(this, function () {
//             return [
//                 2,
//                 new Promise(function (t) {
//                     var n = AL_GAME_HUA_GameData.GameData.getInstance();
//                     1 != n.huoqu_yijiesuo_guanqia() || n.shifou_lao_yonghu()
//                         ? cc.director.loadScene(AL_GAME_HUA_Define.Define.SCENE[1], function () {
//                               return __awaiter(e, void 0, void 0, function () {
//                                   return __generator(this, function () {
//                                       AL_GAME_HUA_EventConfig.EventConfig.getInstance().customEvent("30002");
//                                       AL_GAME_HUA_ServerBackup.ServerBackup.zhixing_suoyou_cundang_de_caozuo();
//                                       t();
//                                       return [2];
//                                   });
//                               });
//                           })
//                         : (n.youxi_shouci_jinru(),
//                           AL_GAME_HUA_Instance.Instance.qianwang_youxi({
//                               onLaunch: function () {
//                                   AL_GAME_HUA_EventConfig.EventConfig.getInstance().customEvent("300021");
//                                   t();
//                               }
//                           }));
//                 })
//             ];
//         });
//     });
// };
// a.chushihua_duoyuyan = function () {
//     return AL_GAME_HUA_i18nMgr.i18nMgr.init();
// };
// window.AL_GAME_HUA_Global = r;

/**
 * AL_GAME_HUA_Global 模块
 * @module AL_GAME_HUA_Global
 */
exports.AL_GAME_HUA_Global = void 0;

const i18nMgr = require("./AL_GAME_HUA_i18nMgr");
const EventConfig = require("./AL_GAME_HUA_EventConfig");
const GameConst = require("./AL_GAME_HUA_GameConst");
const GoodsConfig = require("./AL_GAME_HUA_GoodsConfig");
const LatticeConfig = require("./AL_GAME_HUA_LatticeConfig");
const LevelConfig = require("./AL_GAME_HUA_LevelConfig");
const MissionConfig = require("./AL_GAME_HUA_MissionConfig");
const PropConfig = require("./AL_GAME_HUA_PropConfig");
const RankConfig = require("./AL_GAME_HUA_RankConfig");
const ShopConfig = require("./AL_GAME_HUA_ShopConfig");
const GameData = require("./AL_GAME_HUA_GameData");
const Instance = require("./AL_GAME_HUA_Instance");
const Common = require("./AL_GAME_HUA_Common");
const Define = require("./AL_GAME_HUA_Define");
const PlatformManager = require("./AL_GAME_HUA_PlatformManager");
const DateData = require("./AL_GAME_HUA_DateData");
const PayConfig = require("./AL_GAME_HUA_PayConfig");
const PayData = require("./AL_GAME_HUA_PayData");
const ServerTime = require("./AL_GAME_HUA_ServerTime");
const ServerBackup = require("./AL_GAME_HUA_ServerBackup");
const WorldRankConfig = require("./AL_GAME_HUA_WorldRankConfig");
const WelfareConfig = require("./AL_GAME_HUA_WelfareConfig");
const ElementConfig = require("./AL_GAME_HUA_ElementConfig");
const PlayerInfo = require("./AL_GAME_HUA_PlayerInfo");

const AL_GAME_HUA_Global = exports.AL_GAME_HUA_Global || {};

/**
 * 初始化加载
 */
AL_GAME_HUA_Global.onLoad = async function () {
    EventConfig.EventConfig.getInstance().customEvent("30004");
    Common.Common.shezhi_anniu_yinyue(Define.Define.GAME_NAME, "audio/Button");
    Common.Common.playMusic("BGM");
    PlatformManager.PlatformManager.getInstance().init();
    await ServerTime.default.create_Server_Time_Com();
    DateData.DateData.getInstance().jiancha_riqi_he_zhou_shifou_xuyao_shuaxin();
    PayData.PayData.getInstance().jiancha_zhifu_shuju();
    Instance.Instance.chuangjian_jishiqi_jiluqi();
    PlayerInfo.PlayerInfo.getInstance().huoqu_shifou_wei_xin_yonghu();
    PayConfig.PayConfig.getInstance().jiancha_dingdan();
    await Promise.all([Instance.Instance.chuangjian_dingbu_gongju_lan()]);
};

/**
 * 加载配置
 */
AL_GAME_HUA_Global.jiazai_peizhi = async function () {
    await GameConst.GameConst.getInstance().jiazai_peizhi();
    GameConst.GameConst.getInstance().jiazai_yuancheng_peizhi();
    await GoodsConfig.GoodsConfig.getInstance().jiazai_peizhi();
    await Promise.all([
        LatticeConfig.LatticeConfig.getInstance().jiazai_peizhi(),
        LevelConfig.LevelConfig.getInstance().jiazai_peizhi(),
        LevelConfig.LevelConfig.getInstance().jiazai_tiaozhan_guanqia_peizhi(),
        LevelConfig.LevelConfig.getInstance().jiazai_teshu_guanqia_peizhi(),
        ElementConfig.ElementConfig.getInstance().jiazai_peizhi(),
        RankConfig.RankConfig.getInstance().jiazai_peizhi(),
        ShopConfig.ShopConfig.getInstance().jiazai_peizhi(),
        PropConfig.PropConfig.getInstance().jiazai_peizhi(),
        EventConfig.EventConfig.getInstance().jiazai_peizhi(),
        MissionConfig.MissionConfig.getInstance().jiazai_peizhi(),
        PayConfig.PayConfig.getInstance().jiazai_peizhi(),
        WorldRankConfig.WorldRankConfig.getInstance().jiazai_peizhi(),
        WelfareConfig.WelfareConfig.getInstance().jiazai_peizhi()
    ]);
    EventConfig.EventConfig.getInstance().customEvent("30006");
};

/**
 * 进入第一个场景
 */
AL_GAME_HUA_Global.jinru_diyige_changjing = async function () {
    return new Promise((resolve) => {
        const gameDataInstance = GameData.GameData.getInstance();
        if (gameDataInstance.huoqu_yijiesuo_guanqia() !== 1 || gameDataInstance.shifou_lao_yonghu()) {
            cc.director.loadScene(Define.Define.SCENE[1], async () => {
                EventConfig.EventConfig.getInstance().customEvent("30002");
                ServerBackup.ServerBackup.zhixing_suoyou_cundang_de_caozuo();
                resolve();
            });
        } else {
            gameDataInstance.youxi_shouci_jinru();
            Instance.Instance.qianwang_youxi({
                onLaunch() {
                    EventConfig.EventConfig.getInstance().customEvent("300021");
                    resolve();
                }
            });
        }
    });
};

/**
 * 初始化国际化
 */
AL_GAME_HUA_Global.chushihua_duoyuyan = function () {
    return i18nMgr.i18nMgr.init();
};

window.AL_GAME_HUA_Global = AL_GAME_HUA_Global;
